package com.test.design.pattern.objserver;

/**
 * @ClasName Client
 * @Descripution TODO
 * @Author USER
 * @Date 2022/2/24 14:14
 * @Version V1.0
 */
public class Client {

    public static void main(String[] args) {
        //1,创建公众号对象
        SubscriptionSubject subject = new SubscriptionSubject();

        //2,订阅公众号
        subject.attach(new WeiXinUser("孙悟空"));
        subject.attach(new WeiXinUser("猪悟能"));
        subject.attach(new WeiXinUser("沙悟净"));


        //3,公众号更新，发出消息给订阅者（观察者对象）
        subject.notify("公众号的更新了！");

    }

}
